<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>图片上传</title>
    <style type="text/css">
      html,body{margin:0;padding:0;width:{$width}px;height:{$height}px;}
      .uploadpic{position:relative;}
      #ImgPr{border:0;}
      .puloadpic{position:absolute;width:{$width}px;height:{$height}px;}
      .inputfile{position:absolute;top:0px;left:0px;z-index:100;-moz-opacity:0.3;opacity:0.3;filter: alpha(opacity=30);background:#4f99c6;cursor:pointer;}
      #uploadicon{font-size:200px;overflow:hidden;display:block;width:{$width}px;height:{$height}px;-moz-opacity:0.0;opacity:0.0;filter: alpha(opacity=0);cursor:pointer;}
      .uploadtext{position:absolute;top:0px;left:0px;z-index:50;color:red;font-weight:bold;text-align:center;width:{$width}px;height:{$height}px;line-height:{$height}px;cursor:pointer;overflow:hidden;}
	  </style>
    <!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='/static/ace1.4/assets/js/jquery-2.1.4.min.js'>"+"<"+"/script>");
		</script>
		<!-- <![endif]-->
		<!--[if IE]>
		<script type="text/javascript">
		 window.jQuery || document.write("<script src='/static/ace1.4/assets/js/jquery1x.js'>"+"<"+"/script>");
		</script>
		<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='/static/ace1.4/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
  </head>
  <body>
    <form enctype="multipart/form-data" id="PostMe" action="" method="post" name="upform">
      <input type="hidden" value="{$width}" name="width">
      <input type="hidden" value="{$height}" name="height">
      <input type="hidden" value="{$backcall}" name="backcall">
      <input type="hidden" value="{$backcall_name}" name="backcall_name">
      <div class="uploadpic">
        <?php if($upload_type == 'image'): ?>
          <?php if(empty($image)): ?>
            <img id="ImgPr" src="{$site_root}/static/admin/images/nopic.gif"  width="{$width}" height="{$height}">
            <div class="uploadtext">上传图片</div>
          <?php else: ?>
            <img id="ImgPr" src="{$image}"  width="{$width}" height="{$height}">
            <div class="uploadtext">重新上传</div>
          <?php endif; ?>
    			<div class="inputfile" title="点击上传图片">
    				<input type="file" name="image" id="uploadicon" value="upload"/>
    			</div>
        <?php else: ?>
          <img id="ImgPr" src="{$site_root}/static/admin/images/nopic.gif"  width="{$width}" height="{$height}">
          <?php if(empty($image)): ?>
            <div class="uploadtext">上传附件</div>
          <?php else: ?>
            <div class="uploadtext">覆盖附件</div>
          <?php endif; ?>
          <div class="inputfile" title="点击上传附件">
            <input type="file" name="image" id="uploadicon" value="upload" accept="application/x-zip-compressed,application/x-rar-compressed,image/*,application/pdf,application/vnd.ms-excel,application/msword,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation"/>
          </div>
        <?php endif; ?>
  		</div>
    </form>
    <script type="text/javascript">
      $('#uploadicon').on("change",function(){
        $('#PostMe').submit();
        //alert('d');
      });
      $('#{$backcall}', parent.document).val("{$id}");
    </script>
  </body>
</html>